<%@ page language="java"  contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="ChartDirector.*,com.ncjzw.ms.vo.MonthChartVO,java.util.*;"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
@SuppressWarnings("all") 
List<MonthChartVO> mcvolist = (ArrayList)request.getAttribute("data"); 

int len = mcvolist.size();

// The data for the pie chart
double[] data = new double[len];
// The labels for the pie chart
String[] labels = new String[len];
MonthChartVO mcvo = null;

for(int i =0 ;i<len;i++)
{
  mcvo = mcvolist.get(i);
  data[i] = mcvo.getCount();
  labels[i] = mcvo.getSname();
}

// Create a XYChart object of size 600 x 250 pixels
XYChart c = new XYChart(800, 480);

c.setBackground(0xE9FAFF);

// Add a title to the chart using Arial Bold Italic font
c.addTitle("南充兼职网"+request.getAttribute("time")+"各校区会员会员分布图", "华文新魏",16, 0x008000).setBackground(0xE1E5EE);

// Set the plotarea at (100, 30) and of size 400 x 200 pixels. Set the plotarea
// border, background and grid lines to Transparent
c.setPlotArea(170, 30, 600, 440, Chart.Transparent, Chart.Transparent,
    Chart.Transparent, Chart.Transparent, Chart.Transparent);

// Add a bar chart layer using the given data. Use a gradient color for the bars,
// where the gradient is from dark green (0x008000) to white (0xffffff)
BarLayer layer = c.addBarLayer(data, c.gradientColor(100, 0, 800, 0, 0x008000,
    0xffffff));

// Swap the axis so that the bars are drawn horizontally
c.swapXY(true);

// Set the bar gap to 10%
layer.setBarGap(0.1);

// Use the format "US$ xxx millions" as the bar label
layer.setAggregateLabelFormat("会员数:{value}(人)");

// Set the bar label font to 10 pts Times Bold Italic/dark red (0x663300)
layer.setAggregateLabelStyle("宋体", 10, 0x229122);

// Set the labels on the x axis
TextBox textbox = c.xAxis().setLabels(labels);

// Set the x axis label font to 10pt Arial Bold Italic
textbox.setFontStyle("宋体");
textbox.setFontSize(10);
//textbox

// Set the x axis to Transparent, with labels in dark red (0x663300)
c.xAxis().setColors(Chart.Transparent, 0x1B3143);

//支持中文
c.setDefaultFonts("SIMSUN.TTC","simhei.ttf");

// Set the y axis and labels to Transparent
c.yAxis().setColors(Chart.Transparent, Chart.Transparent);

// output the chart
String chart1URL = c.makeSession(request, "chart1");

// Include tool tip for the chart
String imageMap1 = c.getHTMLImageMap("", "", "title='{xLabel}:会员数:{value}(人)'")
    ;
%>

<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #F8F9FA;
}
-->
</style>

<link href="<%=basePath%>admin/images/skin.css" rel="stylesheet" type="text/css" />
<body>
	<form method="POST" action="member!getMemberMonthChart.action">
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td width="17" height="29" valign="top"
					background="<%=basePath%>admin/images/mail_leftbg.gif">
					<img src="<%=basePath%>admin/images/left-top-right.gif" width="17" height="29" />
				</td>
				<td width="935" height="29" valign="top"
					background="<%=basePath%>admin/images/content-bg.gif">
					<table width="100%" height="31" border="0" cellpadding="0"
						cellspacing="0" class="left_topbg" id="table2">
						<tr>
							<td height="31">
								<div class="titlebt">
									月份统计图
								</div>
							</td>
						</tr>
					</table>
				</td>
				<td width="16" valign="top"
					background="<%=basePath%>admin/images/mail_rightbg.gif">
					<img src="<%=basePath%>admin/images/nav-right-bg.gif" width="16" height="29" />
				</td>
			</tr>
			<tr>
				<td height="71" valign="middle"
					background="<%=basePath%>admin/images/mail_leftbg.gif">
					&nbsp;
				</td>
				<td valign="top" bgcolor="#F7F8F9">
					<table width="100%" height="138" border="0" cellpadding="0"
						cellspacing="0">
						
						<tr>
							<td valign="top">
								<table width="98%" border="0" align="center" cellpadding="0"
									cellspacing="0">
									<tr>
										<td class="left_txt">
											当前位置：月份统计图
										</td>
									</tr>
									<tr>
										<td height="20">
											<table width="100%" height="1" border="0" cellpadding="0"
												cellspacing="0" bgcolor="#CCCCCC">
												<tr>
													<td></td>
												</tr>
											</table>
										</td>
									</tr>
									<tr>
										<td>
											<table width="100%" height="55" border="0" cellpadding="0"
												cellspacing="0">
												<tr>
													<td width="10%" height="55" valign="middle">
														<img src="<%=basePath%>admin/images/title.gif" width="54" height="55">
													</td>
													<td width="90%" valign="top">
														<span class="left_txt2">在这里，您可以根据您的网站要求，修改设置网站的</span><span
															class="left_txt3">基本参数</span><span class="left_txt2">！</span>
														<br>
														<span class="left_txt2">包括</span><span class="left_txt3">网站名称，网址，网站备案号，联系方式，网站公告，关键词，风格</span><span
															class="left_txt2">等以及网站</span><span class="left_txt3">会员及等级积分设置</span><span
															class="left_txt2">。 </span>
													</td>
												</tr>
											</table>
										</td>
									</tr>
									<tr>
										<td>
											<table width="100%" height="31" border="0" cellpadding="0"
												cellspacing="0" class="nowtable">
												<tr>
													<td class="left_bt2">
														&nbsp;&nbsp;&nbsp;&nbsp;月份统计图
													</td>
												</tr>
											</table>   
										</td>
									</tr>
									<tr>
										<td height="500">
										 <table border="0" width="100%">
										  <tr>
										   <td>
										    <font size="2">选择年份:</font>&nbsp;
										    <select name="year">   
										          <option value="2007">2007</option>
										          <option value="2008">2008</option>
										          <option value="2009">2009</option>
										          <option selected value="2010">2010</option>
										          <option value="2011">2011</option>
										          <option value="2012">2012</option>
										          <option value="2013">2013</option>
										          <option value="2014">2014</option>
										          <option value="2015">2015</option>
										          <option value="2016">2016</option>
										          <option value="2017">2017</option>
										          <option value="2018">2018</option>
										          <option value="2019">2019</option>
										          <option value="2020">2020</option>
										   </select>&nbsp;&nbsp;&nbsp;&nbsp;
										    <font size="2">选择月份:</font>&nbsp;
										   <select name="month">   
										          <option value="01">01</option>
										          <option value="02">02</option>
										          <option value="03">03</option>
										          <option value="04">04</option>
										          <option value="05">05</option>
										          <option value="06">06</option>
										          <option value="07">07</option>
										          <option value="08">08</option>
										          <option value="09">09</option>
										          <option value="10">10</option>
										          <option value="11">11</option>
										          <option value="12">12</option>
										   </select>&nbsp;&nbsp;&nbsp;&nbsp;
										   <input type="submit" value="查&nbsp;询">   <br>   
										    <img src='<%=basePath%><%=response.encodeURL("utils/getchart.jsp?"+chart1URL)%>'
                                             usemap="#map1" border="0">
                                            <map name="map1"><%=imageMap1%></map>										  
										   </td>
										  </tr>
										 </table>
										
											
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</td>
				<td background="<%=basePath%>admin/images/mail_rightbg.gif">
					&nbsp;
				</td>
			</tr>
			<tr>
				<td valign="middle" background="<%=basePath%>admin/images/mail_leftbg.gif">
					<img src="<%=basePath%>admin/images/buttom_left2.gif" width="17" height="17" />
				</td>
				<td height="17" valign="top"
					background="<%=basePath%>admin/images/buttom_bgs.gif">
					<img src="<%=basePath%>admin/images/buttom_bgs.gif" width="17" height="17" />
				</td>
				<td background="<%=basePath%>admin/images/mail_rightbg.gif">
					<img src="<%=basePath%>admin/images/buttom_right2.gif" width="16" height="17" />
				</td>
			</tr>
		</table>
	</form>
</body>
